
	<input type="hidden" class="layui-input"  name="device.id" value="#(device.id??)" />
	<input type="hidden" class="layui-input"  name="type" value="#(type??)" />
	#(token)
	   
	<div class="layui-row layui-col-space1 task-row">
		#set(req=true)
		#@colStart("激活码",6)
			<input type="text" class="layui-input #if(device.activation_code??&&!e)layui-disabled #end"
				   name="device.activationCode" value="#(device.activation_code??)" lay-verType='tips' placeHolder="必填" lay-verify="required|" maxlength="100"/>
		#@colEnd()
	</div>
	<div class="layui-row layui-col-space1 task-row">
		#set(req=true)
		#@colStart("设备名称",6)
			<input type="text" class="layui-input"  name="device.name" value="#(device.name??)" lay-verType='tips'placeHolder="必填" lay-verify="required|" maxlength="100"/>
		#@colEnd()
	</div>
	<div class="layui-row layui-col-space1 task-row">
		#set(req=true)
		#@colStart('设备分组',6)
		<select name="device.groupId" class="layui-input" lay-search lay-verify="required|">
			<option value="">---请选择---</option>
			#for(data:deviceGroupList)
			<option value="#(data.id??)" #if(device.group_id??==data.id) selected="selected" #end>#(data.name??)</option>
			#end
		</select>
		#@colEnd()
	</div>

	#if(type == 2)
		<div class="layui-row layui-col-space1 task-row">
			#@colStart("有效时间",6)
			<select name="addDays" class="layui-input" lay-search lay-verify="required|">
				<option value="">---请选择---</option>
				<option value="1" selected="selected">1</option>
				<option value="2" >2</option>
				<option value="3" >3</option>
				<option value="4" >4</option>
				<option value="5" >5</option>
				<option value="6" >6</option>
				<option value="7" >7</option>
			</select>
			#@colEnd()
		</div>
	#end
	#if(type == 1)
	<div class="layui-row layui-col-space1 task-row">
		#@colStart("有效时间",6)
		<select name="addDays" class="layui-input" lay-search lay-verify="required|">
			<option value="">---请选择---</option>
			<option value="3" selected="selected">3天</option>
			<option value="30" >一个月</option>
			<option value="90" >三个月</option>
			<option value="180" >六个月</option>
			<option value="365" >一年</option>
			<option value="730" >两年</option>
		</select>
		#@colEnd()
	</div>
	#end

	#@submitButton()

	#define js()
	<script>
		layui.use(['form', 'upload', 'laydate'], function () {
			var $ = layui.$
					, layer = layui.layer
					, form = layui.form
					, upload = layui.upload
					, laydate = layui.laydate;

			//执行一个laydate实例
			laydate.render({
				elem: '#effectiveTime' //指定元素
				, type: 'datetime'
				, min: minDate()

			});
		});

		function minDate() {
			var now = new Date();
			return now.getFullYear() + "-" + (now.getMonth() + 1) + "-" + now.getDate()+" "+
					now.getHours()+":"+(now.getMinutes()+10)+":"+now.getSeconds();
		}
	</script>
	#end